#include "proteinattribwidget.h"
#include "proteindatanode.h"

using namespace PBVP;

ProteinAttribWidget::ProteinAttribWidget(ProteinDataNode *pProNode, QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	m_pProteinNode = pProNode;
	m_pProtein = (ProteinData *)m_pProteinNode->data();

	QString str;
	ui.chainNumLabel->setText(str.setNum(m_pProtein->numOfChains()));
	ui.ligandNumLabel->setText(str.setNum(m_pProtein->numOfLigands()));
	ui.residueNumLabel->setText(str.setNum(m_pProtein->numOfResidues()));
	ui.atomNumLabel->setText(str.setNum(m_pProtein->numOfAtoms()));

	ui.chainList->addItems(m_pProtein->getChainNames());
	ui.ligandList->addItems(m_pProtein->getLigandNames());
}

ProteinAttribWidget::~ProteinAttribWidget()
{

}

void ProteinAttribWidget::setRenderingProperty(QWidget *renderPropWidget)
{
	if(renderPropWidget) {
		renderPropWidget->setParent(ui.renderPropertyTab);
	}
	renderPropWidget->setGeometry(5, 5, renderPropWidget->width(), renderPropWidget->height());
	if(ui.renderPropertyTab->isVisible()) renderPropWidget->show();
}
